package com.qtz.q6iflyspeech.util;

/**
 * Created by temp07 on 2017/4/12.
 */
public class Speex  {
	/* quality
	 * 1 : 4kbps (very noticeable artifacts, usually intelligible)
	 * 2 : 6kbps (very noticeable artifacts, good intelligibility)
	 * 4 : 8kbps (noticeable artifacts sometimes)
	 * 6 : 11kpbs (artifacts usually only noticeable with headphones)
	 * 8 : 15kbps (artifacts not usually noticeable)
	 */
    //private static final int DEFAULT_COMPRESSION = 4;

    public static void init() {
        try {
            System.loadLibrary("speex");
        } catch (Throwable e) {
            e.printStackTrace();
        }
    }
    public static native int decode(byte encoded[], byte lin[], int size, short rate[]);
    public static native int encode(byte lin[], byte encoded[], int size, int compress);

}
